package com.bobbygu.server.simpleapp.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@Controller
public class IndexController {
    private static final String ROOT_HTMLS = "htmls/";

    @RequestMapping("/")
    public String index(Map<String, Object> map) {
        map.put("hello", "from IndexController.index");
        return "index";
    }

    @RequestMapping("test")
    public String test() {
        return ROOT_HTMLS + "test";
    }

    @RequestMapping(value = ROOT_HTMLS + "{request}")
    public String commonMapping(@PathVariable String request) {
        return ROOT_HTMLS + request;
    }
}
